<?php
namespace App\Services;
use Redis,Cache,Log;
use Illuminate\Support\Facades\Redis as Predis;

class RedisService
{
	public static function set($key,$data,$timestamp='')
	{
		
		try {
			Predis::set($key, $data);
			if($timestamp) {
				Predis::expireat($key,$timestamp);
			}		
		} catch(\Exception $e) {
			Log::error($e->getMessage());
		}
		return true;
			
	}

	public static function get($key)
	{
		return Predis::get($key);
	}

	

	public static function del($key)
	{
		return Predis::del($key);
	}
	
	

	public static function exists($key)
	{
		Predis::exists($key);
	}

	

	
		
}
?>